<template>
  <van-cell class="card-raise-apply" center clickable :title="carrier_item.item" :label="apply.apply_time" @click="$emit('onClick', apply)" is-link>
    <template #icon>
      <van-icon class-prefix="cspg" name="jiangli1 cspg-color-yellow" size="30px"/>
    </template>
    <template #default>
      <van-tag :type="tagType" size="medium">{{applyText}}</van-tag>
    </template>
  </van-cell>
</template>

<script>
export default {
  name: 'CardRaiseApply',
  props: ['apply'],
  data () {
    return {
      carrier_item: JSON.parse(this.apply.carrier_item)
    }
  },
  computed: {
    applyText: function () {
      let str = ''
      switch (this.apply.apply_status) {
        case 0:
          str = '待审核'
          break
        case 1:
          str = '待最终审核'
          break
        case 2:
          str = '已复核'
          break
        case 3:
          str = '待复核'
          break
        case 4:
          str = '待修改'
          break
        case 5:
          str = '已完成'
          break
      }
      return str
    },
    tagType: function () {
      let str = 'primary'
      switch (this.apply.apply_status) {
        case 0:
          str = 'warning'
          break
        case 1:
          str = 'primary'
          break
        case 2:
          str = 'success'
          break
      }
      return str
    }
  }
}
</script>

<style scoped lang="less">
  .van-cell__title {
    font-size: 14px;
    padding-left: 5px;
    min-width: 180px;
  }
  .van-cell__value {
    font-size: 12px;
  }
</style>
